package com.fkc.javahansoulbms.config;


import com.fkc.javahansoulbms.interceptor.LoginInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class WebConfig implements WebMvcConfigurer {
	
	@Override
	public void addInterceptors (InterceptorRegistry registry) {
		// 拦截所有用户相关接口，除了登录和注册
		registry.addInterceptor(new LoginInterceptor())
				.addPathPatterns("/api/user/**")
				.excludePathPatterns("/api/user/register", "/api/user/login");
	}
}
